﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// TrinhDo Repository. Good example of CRUD operations.
    ///// </summary>
    public class TrinhDoRepository : ITrinhDoRepository
    {
        private static readonly ITrinhDoDao _trinhDo = DataAccess.TrinhDoDao;
        public List<TrinhDo> GetList()
        {
            return _trinhDo.GetTrinhDo().ToList();
        }

        public TrinhDo Get(string id)
        {
            return _trinhDo.GetTrinhDoByID(id);
        }

        public void Insert(TrinhDo t)
        {
            _trinhDo.InsertTrinhDo(t);
        }

        public void Update(TrinhDo t)
        {
            _trinhDo.UpdateTrinhDo(t);
        }

        public void Delete(TrinhDo t)
        {
            _trinhDo.DeleteTrinhDo(t);
        }

        public List<TrinhDo> GetTrinhDoBySchoolId(int schoolId)
        {
            return _trinhDo.GetTrinhDoBySchoolId(schoolId);
        }
    }
}